package com.example.wblog.service;

import com.example.wblog.dao.ArticleDAO;
import com.example.wblog.model.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {

    @Autowired
    ArticleDAO articleDAO;

    public List<Article> selectList(int offset, int size) {
        return articleDAO.selectList(offset, size);
    }

    public Article selectById(int id) {
        return articleDAO.selectById(id);
    }

    public void add(Article article){
        articleDAO.add(article);
    }

    public void deleteById(int id) {
        articleDAO.deleteById(id);
    }
}
